Memory devices are often used to store data provided by a host. In many situations, the host needs to reorganize previously-stored data from one location in the memory device to another location in the memory device. This reorganization may include move or copy operations, which may be used, for example, when the host is defragmenting the memory device.
A pointer is a programming data type whose value refers directly to (“points to”) another value stored elsewhere in a computer memory using the value's memory address. A pointer references a location in memory, so the value of a pointer is the memory address of the underlying data, and not the data itself. Obtaining the underlying data at the memory address to which a pointer refers is known as “dereferencing” the pointer.
Modern computing systems support a memory management technique known as virtual memory. Virtual memory systems use two types of memory addresses to allow for data access: (1) virtual, or logical, addresses, and (2) physical addresses. A physical address represents a location of data stored on a directly addressable read/write memory (RAM). Before virtual memory systems were in use, any program could access and manipulate data in use by any other program, simply by referencing the physical address in memory of that data. Programs use virtual memory systems instead by referencing virtual addresses when they need to access data stored in memory. Virtual addresses are also known as logical addresses. Using virtual memory, programmers may design programs as if virtual memory is the only kind of memory, and which supports the same reading and writing operations as if it were directly addressable read/write memory. Furthermore, virtual memory systems simplify program design because programmers may design and implement programs as if the virtual memory is a contiguous working memory (an address space) to which the program has sole access. Therefore, programmers do not need to implement specialized modules to defragment working memory or to protect memory from use by other application processes.
To manage virtual memory, most storage devices, in particular SSDs, keep a virtual address to physical address (V2P) table of pointers. The virtual addresses are those issued by the host, and are used by the storage device as keys or indices into each row of the V2P table. Each row of the V2P table contains a physical address pointer that, in turn, points to the block of storage containing the data. These V2P tables are usually architecture-dependent and their implementation depends on the granularity of physical data access inside the storage device. The granularity of the physical data access refers to the fineness with which the storage device subdivides data blocks. For example, if an SSD is using physical block sizes of 16 kilobytes (KB), the V2P table assigns a virtual block number to each of the 16 KB physical blocks in the SSD.
Standard storage device interfaces, such as Serial Advanced Technology Attachment (SATA), Fibre Channel, and Serial Attached SCSI (SAS), do not define commands to trigger the memory device to perform pointer manipulations on its own based on logical addresses provided by the host. Accordingly, to reorganize data in the memory device, the host uses standard read and write commands in existing storage device interfaces. Specifically, the host sends a standard read command to the memory device via a bus and specifies a logical address of a source location in the memory. The memory device then translates the logical address to a physical address by looking up the logical address in the V2P table to find the associated physical address, reads the data from the source location, and sends the read data over the bus to the host. The host then stores the read data in a buffer and later sends the read data back to the memory device over the bus along with a standard write command that specifies a logical address of the destination location in the memory. As described above, the memory device then translates the destination location's logical address to a physical address and writes the data to the destination location's physical address.
There are several disadvantages associated with this process of reading from the device, buffering on the host, and writing data to the host. These disadvantages are reasons why reading and writing data is referred to as “costly” or “expensive” in terms of device performance. Because the host is involved in every step of the process, this process occupies the central processing unit (CPU) of the host, wastes power, blocks other user operations that otherwise could have been performed, and requires that the host contain a buffer to store read data. This process also ties up the communication bus between the host and the memory device since data is sent from the memory device to the host and then back to the memory device. Finally, it prevents the memory device management system from performing more sophisticated optimizations, such as avoiding the reading, buffering, and writing operations entirely and, instead, simply updating a table of pointers that map from the virtual or logical address space understood by the host to the physical address space understood by the storage device.
Ideally, reorganizing previously-stored data on the memory device should not require comparatively slow reading and re-writing of the data and, instead, should be accommodated by updating a table of pointers that are significantly faster to manipulate. For example, using current computing systems, a page of memory may take on the order of 100 microseconds to be written, or milliseconds to be erased. This means that a page of memory may take ten times as long to be erased as to be written. Although these durations may appear short, a table of pointers may be implemented in even faster memory including dynamic random-access memory (DRAM). As a result, updating rows in a table of pointers may take nanoseconds, which is 100,000 times faster than writing a page of memory.
While standard storage device interfaces do not define commands to trigger the memory device to perform a data reorganization operation on its own based on logical addresses provided by the host, a host can provide a command to some flash memory devices to reorganize data between physical addresses specified by the host. These commands would be performed on a raw flash physical device level (i.e., on the memory chip itself) and would be issued by the host.